Keystore: avoid key id duplicates in wh_Client_*MakeCacheKey functions#255
Closed
rizlik wants to merge 2 commits intowolfSSL:mainfrom
Closed
Keystore: avoid key id duplicates in wh_Client_*MakeCacheKey functions#255rizlik wants to merge 2 commits intowolfSSL:mainfrom
rizlik wants to merge 2 commits intowolfSSL:mainfrom
Conversation
billphipps
requested changes
Dec 1, 2025
Contributor
billphipps
left a comment
There was a problem hiding this comment.
We need to fix more issues like this in keystore. This fixes a problem in the wrong way. I'll reach out with details.
| /* Get the appropriate cache context for this key */ | ||
| ctx = _GetCacheContext(server, keyId); | ||
|
|
||
| /* Evict keyId from cache to avoid duplicates */ |
Contributor
There was a problem hiding this comment.
keyId here is very likely NOT the actual keyid that the user is wanting. It was recently added so that the server context could choose between global and local keycaches based on the top bits of the keyid itself. Additionally, evicting a key would be an unexpected side effect of asking the server for an empty cache slot.
Instead, the cache slot logic for "making" a key should match that for importing a key:
- Search appropriate cache looking for a matching keyid (should use FindInCache). If found, use that key slot. Remember to reset the committed flag since this key slot will no longer match the backing store (if it had been previously committed).
- Find an empty key slot using GetCacheSlot. If found, use that key slot
There's lots more issues in keystore that I can now see. We need to work all of them. More to come
Contributor
Author
|
close, fixed in another pr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.